# coding:utf-8
__author__ = "Xuhao"

from lxml import etree
from config import  RULES
from spider.HtmlDownloader import Html_Downloader
from spider.HtmlPraser import Html_Parser
from  config import RULES
from  config import CONTENTFILTER
import  re
from util.tool import Tool


html1 = """ 
    <div class="box-s1-l"> 
        <div class="col"> <span class="day_s">白天</span> 
            <div class="w-icon"><img alt='多云' src='http://www.sinaimg.cn/dy/weather/images/yb2/45_45/duoyun_0.gif' /></div> 
            <h2>多云</h2> 
            <div class="w-number"> <span class="tpte">14℃</span> </div> 
        </div> 
        <div class="col"> <span class="day_s">夜间</span> 
            <div class="w-icon"><img alt='多云' src='http://www.sinaimg.cn/dy/weather/images/yb2/45_45/duoyun_1.gif' /></div> 
            <h2>多云</h2> 
            <div class="w-number"> <span class="tpte">6℃</span> </div> 
        </div> 
    </div> 
"""

# root = etree.HTML(html)
# bookList = root.xpath('.//div[@class="result-item result-game-item"')
#
# for book in bookList:
#     print(book.xpath('.//a[@cpos="title"]'))


if __name__ == '__main__':
    #html_parser = Html_Parser()

    str = '作者：唐家三少     ' \
          '类型：玄幻魔法'
    print(re.findall(r'.*?作者：(.*?)类型', str))

    url = {'urls': ['http://zhannei.baidu.com/cse/search?q=&%s&s=2758772450457967865&srt=totalClick&nsid=0' % n for n in
             ['p='] + list(range(1, 10))]}
    i = ['http://www.suimeng.la/allvisit-%s.html' % n for n in range(1, 10)]

